﻿@using System.Linq.Expressions;
@using Microsoft.AspNetCore.Authorization;
@using Microsoft.Extensions.Logging
@using ThingsGateway.Admin.Application;
@using ThingsGateway.Admin.Blazor
@using ThingsGateway.Core.Extension
@using ThingsGateway.Gateway.Application
@namespace ThingsGateway.Plugin.QuestDB
@inject UserResoures UserResoures
@inherits BaseComponentBase


<AppDataTable @ref="_datatable" TItem="QuestDBHistoryValue" SearchItem="QuestDBPageInput"
              AddItem="object" EditItem="object" IsShowSelect=false
              SearchModel="@_search" IsShowOperCol=true
              QueryCallAsync="QueryCallAsync" FirstQuery=false
                IsShowDetailButton IsShowQueryButton>
    <SearchTemplate>

        <PDateTimePicker @bind-Value="context.StartTime"
                         TimeFormat="TimeFormat.Hr24"
                         ViewType="DateTimePickerViewType.Compact">
            <ActivatorContent Context="dt">
                <MTextField @bind-Value="context.StartTime" Label=@AppService.I18n.T(context.Description(x => x.StartTime))
                                    Clearable Class="my-1  mx-2 "
                                    Filled Outlined
                                    Readonly Dense
                             @attributes="@dt.Attrs">
                 </MTextField>
             </ActivatorContent>
             </PDateTimePicker>

             <PDateTimePicker @bind-Value="context.EndTime"
                              TimeFormat="TimeFormat.Hr24"
                              ViewType="DateTimePickerViewType.Compact">
             <ActivatorContent Context="dt">
                 <MTextField @bind-Value="context.EndTime" Label=@AppService.I18n.T(context.Description(x => x.EndTime))
                                    Clearable Class="my-1  mx-2 "
                                    Filled Outlined
                                    Readonly Dense
                             @attributes="@dt.Attrs">
                 </MTextField>
             </ActivatorContent>
             </PDateTimePicker>



             <MTextField Dense Style="max-width:200px;" HideDetails=@("auto") Class="my-1 mx-2 " Outlined
                     @bind-Value="context.VariableName" Label=@AppService.I18n.T(context.Description(x => x.VariableName)) />



     </SearchTemplate>


     </AppDataTable>


